package com.wifipositioner.measure;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;

import android.os.Environment;

import com.wifipositioner.Globals;
import com.wifipositioner.positioning.RefPointCache;
import com.wifipositioner.positioning.ReferencePoint;

public class Util {
	
	public static void printCache(){
		
		try {
			
			
			File root = Environment.getExternalStorageDirectory();
			 File gpxfile = new File(root, "out.txt");
		        FileWriter gpxwriter = new FileWriter(gpxfile);
		        BufferedWriter out = new BufferedWriter(gpxwriter);
		        RefPointCache.get().getRefPointList();
				for(MeasuredPoint point : RefPointCache.get().getRefPointList()){
					out.write(point.getName()+ "\n");
					for(String ssid : point.scanMap.keySet()){
						 out.write("  " + ssid + " ss: " +point.scanMap.get(ssid) + "\n");
					}
				}
		        out.close();
		} catch (Exception e) {
			// TODO: handle exception
		}
		
		
		
	}
}
